Skip to content

Setup auth#4

Merged
sooom1627 merged 11 commits intomainfrom
setup-auth
Feb 9, 2025
Merged

Setup auth#4
sooom1627 merged 11 commits intomainfrom
setup-auth

Conversation

@sooom1627
Copy link
Owner

@sooom1627 sooom1627 commented Feb 9, 2025

Summary by CodeRabbit

  • New Features
    • Launched new authentication flows including dedicated login, signup, and protected content screens.
    • Added a signout option along with enhanced interactive buttons and links for a smoother user experience.
  • Refactor
    • Improved session management and routing to automatically direct users based on their authentication status.
  • Chores
    • Updated connectivity settings and styling configurations to ensure consistent and reliable application behavior.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 9, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This pull request removes configuration files with Supabase environment variables and introduces new authentication components along with associated service functions. The changes add layouts and screens for login, signup, and protected areas while restructuring the main layout to manage session state and routing. Additionally, UI components such as buttons and links have been created, and the Supabase client configuration has been updated from environment variables to hardcoded values. Tailwind CSS configuration was also expanded to scan additional directories.

Changes

File(s) Change Summary
.env.dev, .env.example Removed environment configuration files containing Supabase credentials and placeholders.
app/(auth)/_layout.tsx, app/(auth)/loginScreen.tsx, app/(auth)/signupScreen.tsx Added authentication layout and screen components (AuthLayout, LoginScreen, SignupScreen) for handling user authentication.
app/(protected)/_layout.tsx, app/(protected)/index.tsx Introduced ProtectedLayout for authenticated routing and integrated SignoutButton in the protected view.
app/_layout.tsx Restructured main layout to include session management, current session retrieval, and conditional routing based on authentication status.
components/button/PrimaryButton.tsx, components/link/DefaultLink.tsx Added UI components: PrimaryButton with dynamic styling and DefaultLink styled for navigation.
fetaure/auth/components/SignoutButton.tsx, fetaure/auth/screen/Login.tsx, fetaure/auth/screen/Signup.tsx Implemented SignoutButton, Login, and Signup components to support respective authentication workflows.
fetaure/auth/service/authService.ts Added async functions: loginWithEmail, signupWithEmail, and signout for managing user authentication with Supabase.
lib/supabase.ts Updated Supabase client configuration to utilize hardcoded URL and anonymous key instead of environment variables.
tailwind.config.js Expanded Tailwind CSS content paths to include files in the “fetaure” directory for scanning class names.

Sequence Diagram(s)

sequenceDiagram
    participant U as User
    participant R as RootLayout
    participant SS as Supabase
    participant LS as LoginScreen
    participant AS as authService
    participant P as ProtectedLayout

    U->>R: Launch App
    R->>SS: Request current session
    SS-->>R: Return session data (or null)
    alt Session exists
        R->>P: Render ProtectedLayout
        P-->>U: Display protected content with SignoutButton
    else No session
        R->>LS: Redirect to LoginScreen
        U->>LS: Enter credentials
        LS->>AS: Call loginWithEmail()
        AS->>SS: Authenticate credentials
        SS-->>AS: Return session/token
        AS-->>LS: End loading & update session
        LS->>R: Trigger session update
        R->>P: Render ProtectedLayout
    end
Loading
sequenceDiagram
    participant U as User
    participant SB as SignoutButton
    participant AS as authService
    participant SS as Supabase

    U->>SB: Click Signout
    SB->>AS: Invoke signout()
    AS->>SS: Request signout
    SS-->>AS: Confirm signout
    AS-->>SB: Update UI and redirect to login
Loading

Poem

I'm a little rabbit, hopping with glee,
Codes and layouts set my spirit free.
New auth screens and signout in play,
Environment secrets hopped well away.
I nibble on changes and carry on my quest,
With every line, our code's at its best!
Hop along, fellow devs, for greatness lies ahead!


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5a3a02b and 707a298.

📒 Files selected for processing (16)
  • .env.dev (0 hunks)
  • .env.example (0 hunks)
  • app/(auth)/_layout.tsx (1 hunks)
  • app/(auth)/loginScreen.tsx (1 hunks)
  • app/(auth)/signupScreen.tsx (1 hunks)
  • app/(protected)/_layout.tsx (1 hunks)
  • app/(protected)/index.tsx (1 hunks)
  • app/_layout.tsx (1 hunks)
  • components/button/PrimaryButton.tsx (1 hunks)
  • components/link/DefaultLink.tsx (1 hunks)
  • fetaure/auth/components/SignoutButton.tsx (1 hunks)
  • fetaure/auth/screen/Login.tsx (1 hunks)
  • fetaure/auth/screen/Signup.tsx (1 hunks)
  • fetaure/auth/service/authService.ts (1 hunks)
  • lib/supabase.ts (1 hunks)
  • tailwind.config.js (1 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings (Beta)

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@sooom1627 sooom1627 merged commit 668ac76 into main Feb 9, 2025
1 check passed
@sooom1627 sooom1627 deleted the setup-auth branch February 21, 2025 12:11
@coderabbitai coderabbitai bot mentioned this pull request Apr 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant